const getName = new Promise((resolve, reject) => {
    setTimeout(() => {
        resolve('hello node_js 1')
    }, 50)
})

const getNumber = Promise.resolve(1)
const getError = Promise.reject('errors 2')

getError.catch(console.log)

Promise.all([getName, getError])
.then(console.log)
.catch(console.error)

Promise.race([getName, getError])
.then(console.log)
.catch(console.error)

getName.then(name => {
    console.log(name, '3')
    return 20
})
.then(number => {
    console.info(number)
})
